clc;clearvars;clear;
% 画直角坐标系
x = -10 : 1 : 10;
y = -0.1 : 0.1 : 0.5; %设置x轴和y轴的范围
s = -10 : 0.01 : 10;    %自变量s
m = 0;
b = 1;
t = Cauchy_PDF(s,m,b);   %因变量y
plot(s,t,'k');  %先画出函数
axis off;       %去掉背景坐标轴

hold on;
plot([0 0],[min(y) max(y)],'k',[min(x) max(x)],[0 0],'k');  %画出x轴和y轴
ax=[max(x),max(x)-0.3,max(x)-0.3;0,0.02,-0.02];
fill(ax(1,:),ax(2,:),'k');  %填充x轴箭头区域
ay=[0,0.2,-0.2;max(y),max(y)-0.02,max(y)-0.02];
fill(ay(1,:),ay(2,:),'k');  %填充y轴箭头区域

hold on
for i=1:length(x)-1
    if x(i)~=0
        plot([x(i),x(i)],[0,0.01],'k'); %填充x轴上的刻度(做两点之间的连线[x(i),x(i)]代表宽,[0,0.1]代表长)
        hold on
        a=text(x(i),-0.01,num2str(x(i)),'FontSize',14);
        set(a,'HorizontalAlignment','center')
    end

end
for i=1:length(y)-1
    if y(i)~=0
        plot([0,0.15],[y(i),y(i)],'k');  %填充y轴上的刻度
        hold on
        b=text(-0.2,y(i),num2str(y(i)),'FontSize',14);
        set(b,'HorizontalAlignment','center')
    end
end

